//
//  BQAdressVC.m
//  BeeQuick
//
//  Created by Vivitickey on 2017/5/6.
//  Copyright © 2017年 test. All rights reserved.
//

#import "BQAdressCell.h"
#import "BQAdressModel.h"
#import "BQAlterAdressTV.h"
@interface BQAdressCell ()
@property (weak, nonatomic) IBOutlet UILabel *accept_nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *telphoneLabel;
@property (weak, nonatomic) IBOutlet UILabel *addressLabel;

@end

@implementation BQAdressCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (IBAction)ClickEditButton:(id)sender {
    
    BQAlterAdressTV *alterTV = [[BQAlterAdressTV alloc]init];
    
    alterTV.model = self.model;
    
    [[self viewController].navigationController pushViewController:alterTV animated:YES];
    
}

-(void)setModel:(BQAdressModel *)model{
    
    _model = model;
    
    _accept_nameLabel.text = model.accept_name;
    
    _telphoneLabel.text = model.telphone;
    
    _addressLabel.text = model.address;
    
}

- (UIViewController *)viewController {
    for (UIView * next = [self superview]; next; next = next.superview) {
        UIResponder * nextResponder = [next nextResponder];
        if ([nextResponder isKindOfClass:[UIViewController class]]) {
            return (UIViewController *)nextResponder;
        }
    }
    return nil;
}

@end
